from django.shortcuts import render
from django.http import HttpRequest,HttpResponse
from personinfo.models  import Personinfo
# Create your views here.

def getinfo(request):
    try:
        name = request.POST.get('name')
        queryinfo=Personinfo.objects.filter(name__contains=name).all()
        names=[person.name for person in queryinfo ]
        context = {
            'names': names,
        }
    except Exception as e:
        print(e)

    return render(request,'test.html',context)